package com.wulijie.composite;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author cui
 * @Data
 */
public class College extends OrgComposite{

    private List<OrgComposite> list = new ArrayList<OrgComposite>();

    public College(String name, String des) {
        super(name, des);
    }

    @Override
    void add(OrgComposite orgComposite) {
        list.add(orgComposite);
    }

    @Override
    void remove(OrgComposite orgComposite) {
        list.remove(orgComposite);
    }

    @Override
    void print() {
        for (OrgComposite composite : list) {
            System.out.println(composite.getName());
            composite.print();
        }
    }


}
